﻿using HoverTree.BLL;
using HoverTree.HoverTreeFrame;
using HoverTree.Model;
using System;
using System.Collections.Generic;

namespace HoverTreeMobile.hvtimg
{
    public partial class HvtPicList : System.Web.UI.Page
    {
        protected int _totalCount, _totalPageCount, _pageIndex, _pageSize;
        protected void Page_Load(object sender, EventArgs e)
        {
            _pageIndex = RequestHelper.GetQueryInt("pi", 1);
            _pageSize = 10;

            PictureSelect m_pictrueSelect = new PictureSelect();

            m_pictrueSelect.HvtImageSetId = RequestHelper.GetQueryInt("isid", -1);

            //获取图集信息
            ImageSetInfo m_isInfo = new ImageSetInfo();
            if (m_pictrueSelect.HvtImageSetId > 0)
            {
                HvtImageSet m_bll = new HvtImageSet();
                m_isInfo = m_bll.GetByID(m_pictrueSelect.HvtImageSetId);
                if (m_isInfo == null)
                {
                    m_pictrueSelect.HvtImageSetId = -1;
                }
                else
                {
                    ltlImageSetTitle.Text = m_isInfo.HvtTitle;
                    //hlSet.Text = "查看图集全部图片";
                    //hlSet.NavigateUrl = "?isid=" + m_pictrueSelect.HvtImageSetId.ToString();
                }
            }

            m_pictrueSelect.HvtIsShow = 1;

            List<PictureInfo> m_pictureList = new List<PictureInfo>();
            m_pictureList = new HvtPicture().HvtPageQuery(m_pictrueSelect, 3, _pageSize, _pageIndex, out _totalCount, out _totalPageCount);

            rptList.DataSource = m_pictureList;
            rptList.DataBind();

            string m_morePara = "";
            if (m_pictrueSelect.HvtImageSetId > 0)
                m_morePara = "isid=" + m_pictrueSelect.HvtImageSetId.ToString();
            ltlPages.Text = HoverTree.HoverTreeFrame.WebUI.KeleyiPager.BuildPageIndex(_pageIndex, _totalPageCount, m_morePara);

        }
    }
}